package com.cool.java11.functionsable;

/**
 * @Author ifredomvip@gmail.com
 * @Date 2022/9/20 14:51
 * @Version 1.0.0
 * @Description
 **/
public class DefineSwitch {

    public static BranchInterface changeHandle(Boolean state) {
        return (success, fail) -> {
            if (state) {
                success.run();
                System.out.println("success callback");
            } else {
                System.out.println("fail callback");
            }
        };
    }
}
